IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spDivisions_RetrieveAll')
	BEGIN
		PRINT 'Dropping Procedure spDivisions_RetrieveAll'
		DROP  Procedure  spDivisions_RetrieveAll
	END

GO

PRINT 'Creating Procedure spDivisions_RetrieveAll'
GO

CREATE Procedure spDivisions_RetrieveAll
	(
		@DivisionName varchar(50) = null
	)
AS
    /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02	Initial version created
    ------------------------------------------------------------------------------
    */
	
	SET NOCOUNT ON
	
	-- Retrieve the relevant records
	SELECT  *
	FROM	Divisions
	
	WHERE	(@DivisionName IS NULL OR Divisions.DivisionName LIKE @DivisionName + '%')

	-- Return to calling method
	RETURN
GO
